# coding=utf-8
n = int(input())
a = [[x for x in range(1,n+1)] for _ in range(n)]
for i in a:
    print(i)